<?php
require_once FOREGROUND_MOBILE_COMMON_ACTION_DIR . '/member_ajax.php';

class foreground_mobile_member_mobile_do_login_action extends foreground_mobile_member_ajax_common_action
{
    protected $_if_require_login = false;
    
    protected function _current_page_run()
    {
        //var_dump(__METHOD__); exit();
        
        $foreground_member_mobile_do_login_action_service = wwy_resource_container::get_foreground_member_mobile_do_login_action_service();
        
        self::$data['session_member_login_captcha'] = init_user_data_key($_SESSION, 'member_login_captcha', 'str');
        unset($_SESSION['member_login_captcha']);
        
        $foreground_member_mobile_do_login_action_service->process();          
        
        if(self::$_view_status == 1){
            $set_session_member_info = self::$data['set_session_member_info'];
        
            $_SESSION['member_id']                 = $set_session_member_info['id'];
            $_SESSION['member_mobile']             = $set_session_member_info['mobile'];
            $_SESSION['member_default_address_id'] = $set_session_member_info['default_address_id'];
        }
        
        $result = self::get_view_result();
        
        //@ob_end_clean();
        echo json_encode($result);      
        
        //var_dump(self::$_view_data); exit();
    }
}